package com.mycjj.android.adapter;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.mycjj.android.R;
import com.mycjj.android.bean.CarNetworkBean;

public class CarNetworkAdapter extends TAdapter<CarNetworkBean>{

	public CarNetworkAdapter(Context mContext) {
		super(mContext);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			convertView = LayoutInflater.from(mContext).inflate(R.layout.item_carnetwork, null);
			holder = new ViewHolder();
			holder.iv_pic = (ImageView) convertView.findViewById(R.id.iv_pic);
			holder.tv_title = (TextView)convertView.findViewById(R.id.tv_title);
			holder.tv_poople = (TextView)convertView.findViewById(R.id.tv_poople);
			holder.tv_article = (TextView)convertView.findViewById(R.id.tv_article);
			holder.tv_new = (TextView)convertView.findViewById(R.id.tv_new);
			convertView.setTag(holder);
		}else{
			holder = (ViewHolder) convertView.getTag();
		}
		CarNetworkBean bean = mList.get(position);
//		imageLoader.displayImage(bean.getImage(), holder.iv_pic);
		imageLoader1.displayImage(bean.getImage(), holder.iv_pic, options, animateFirstListener);
		holder.tv_title.setText(bean.getName());
		holder.tv_poople.setText(String.valueOf(bean.getMember_count()));
		holder.tv_article.setText(String.valueOf(bean.getTheme_count()));
		holder.tv_new.setText(String.valueOf(bean.getNew_count()));
		return convertView;
	}
	
	static class ViewHolder{
		ImageView iv_pic;
		TextView tv_title;
		TextView tv_poople;
		TextView tv_article;
		TextView tv_new;
	}
	
	

}
